package cn.edu.neu.softlab633.influencemaximization.sy.datapreprocessing;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

/**
 * Created by Jason on 2017/5/14.
 */
public class testdataPrecessing implements Preprocessing{
    @Override
    public void topicPreprocessing() throws Exception {

    }

    @Override
    public void relationPreprocessing() throws Exception {
        BufferedReader br = new BufferedReader(new FileReader("testdata/facebook_combined.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("testdata/f.txt"));
        String line = br.readLine();
        while (line != null) {
            double random = Math.random();
            int a = Integer.valueOf(line.split(" ")[0]);
            int b = Integer.valueOf(line.split(" ")[1]);
            bw.write(a + "," + b + "," + random);
            bw.newLine();
            line = br.readLine();
        }
        br.close();
        bw.close();
    }
}
